import PropTypes from "prop-types";

function PropsJinjie(props){

    PropTypes.checkPropTypes({
        colors: PropTypes.array.isRequired
    }, props, 'props', 'PropsJinjie');
    return(
        <div>
            组件的子节点：{props.children}

            <h1>
                {props.colors ? `Hi,${props.colors}` : 'Hi'}
            </h1>
        </div>
    )
}

const propsJinjieInstance = <PropsJinjie colors={['red', 'blue']}>我是子节点</PropsJinjie>
export default propsJinjieInstance;